Fix MSE queue blocked in some situations #1561
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that an error thrown (and not a promise rejected) by the MSE
appendBuffer
andremove
API did not lead to anupdatestart
nor anupdateend
events which were our triggers to start the next MSE operation in our logic.If we were unlucky to have future operations waiting (in reality this situation is kind of rare as consecutive push operations are merged together) we would be left with a queue only being filled and never being emptied.
To reproduce it, I had to play a local content with a huge buffer size and seeking between DASH Periods like crazy, so hopefully this seems not easily reproducible, but it may well be on non-powerful devices with a too high buffer size?
As written in the code, the solution comes with caveats, but it's still better than what we had before.